home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / uberwidgets / panelframe.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  3KB  |  78 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. from gui.uberwidgets import UberWidget
  6. from gui import skin
  7. from gui.skin.skinobjects import SkinColor, Margins
  8. from cgui import SimplePanel
  9. objget = object.__getattribute__
  10.  
  11. class PanelFrame(SimplePanel, UberWidget):
  12.     
  13.     def __init__(self, parent, panel, skinkey):
  14.         SimplePanel.__init__(self, parent, wx.FULL_REPAINT_ON_RESIZE)
  15.         self.SetSkinKey(skinkey, True)
  16.         if panel.Parent is not self:
  17.             panel.Reparent(self)
  18.         
  19.         self.panel = panel
  20.         sizer = self.Sizer = wx.GridBagSizer()
  21.         sizer.SetEmptyCellSize(wx.Size(0, 0))
  22.         sizer.AddGrowableCol(1, 1)
  23.         sizer.AddGrowableRow(1, 1)
  24.         sizer.Add(panel, (1, 1), flag = wx.EXPAND)
  25.         sizer.Add(wx.Size(self.framesize.left, self.framesize.top), (0, 0))
  26.         sizer.Add(wx.Size(self.framesize.right, self.framesize.bottom), (2, 2))
  27.         self.Bind(wx.EVT_PAINT, self.OnPaint)
  28.  
  29.     
  30.     def __repr__(self):
  31.         return '<PanelFrame for %r>' % self.panel
  32.  
  33.     
  34.     def __getattr__(self, attr):
  35.         
  36.         try:
  37.             return objget(self, attr)
  38.         except AttributeError:
  39.             
  40.             try:
  41.                 return getattr(objget(self, 'panel'), attr)
  42.             except AttributeError:
  43.                 e = None
  44.                 raise e
  45.             except:
  46.                 None<EXCEPTION MATCH>AttributeError
  47.             
  48.  
  49.             None<EXCEPTION MATCH>AttributeError
  50.  
  51.  
  52.     
  53.     def OnPaint(self, event):
  54.         self.framebg.Draw(wx.BufferedPaintDC(self), wx.RectS(self.ClientSize))
  55.  
  56.     
  57.     def UpdateSkin(self):
  58.         key = self.skinkey
  59.         
  60.         s = lambda k, default: skin.get('%s.%s' % (key, k), default)
  61.         self.framebg = s('frame', SkinColor(wx.BLACK))
  62.         self.framesize = s('framesize', Margins([
  63.             0,
  64.             0,
  65.             0,
  66.             0]))
  67.         sz = self.Sizer
  68.         if sz:
  69.             sz.Detach(1)
  70.             sz.Detach(1)
  71.             sz.Add(wx.Size(self.framesize.left, self.framesize.top), (0, 0))
  72.             sz.Add(wx.Size(self.framesize.right, self.framesize.bottom), (2, 2))
  73.         
  74.         wx.CallAfter(self.Layout)
  75.         wx.CallAfter(self.Refresh)
  76.  
  77.  
  78.